from rest_framework.views import exception_handler


def custom_exception_handler(exc, context):

    response = exception_handler(exc, context)

    # Now add the HTTP status code to the response.
    # if response is not None:
    #     print(response.__dict__, 33)
    #     response.data['desc'] = response.data.get('detail')

    return response
